#include <iostream>
#include <string>

using namespace std;

class Solution {
public:
    bool isPalindrome(int x) {
        string str = std::to_string(x);
        bool flag = true;

        size_t size = str.size();
        for (int i = 0; i < size; ++i) {
            size_t j = size - i - 1;
            if (str.at(i) != str.at(j)) {
                flag = false;
                break;
            } else if (j <= i) {
                break;
            }
        }

        return flag;
    };
};
